FROM node

MAINTAINER Yan QiDong <yanqd0@outlook.com>

ARG VERSION=3.2.3

LABEL version=$VERSION

RUN npm config set registry https://registry.npm.taobao.org -g \
        && npm install --global gitbook-cli \
        && gitbook fetch ${VERSION} \
        && npm cache verify \
        && rm -rf /tmp/*

WORKDIR /gitbook

VOLUME /gitbook

CMD gitbook install --registry=https://registry.npm.taobao.org && gitbook build